﻿using NB.MGJ.Log;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http.Filters;

namespace NB.MGJ.API
{
    /// <summary>
    /// 异常记录
    /// </summary>
    public class ApiHandleErrorAttribute : ExceptionFilterAttribute
    {
        public override void OnException(HttpActionExecutedContext actionExecutedContext)
        {
            var _message= actionExecutedContext.Exception.Message;
            var _url= actionExecutedContext.Request.RequestUri.AbsolutePath;
            LoggerManager.LogSysException(actionExecutedContext.Exception);//异常记录
            base.OnException(actionExecutedContext);
        }
    }
}
